package com.easybuy.service.impl;

import com.easybuy.bean.EasybuyNew;
import com.easybuy.mapper.EasybuyNewMapper;
import com.easybuy.service.INewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class NewsServiceImpl implements INewsService {

    @Autowired
    EasybuyNewMapper easybuyNewMapper;

    @Override
    public List<EasybuyNew> listByPage(int page, int pageSize) {
        int from = (page-1)*pageSize;
        return easybuyNewMapper.listByPage(from,pageSize);
    }


    @Override
    public int save(EasybuyNew ebNews) {
        return easybuyNewMapper.save(ebNews);
    }

    @Override
    public int  deleteByPk(int enId) {
        return easybuyNewMapper.deleteByPk(enId);
    }

    @Override
    public EasybuyNew selectByCondition(Integer enId){ return easybuyNewMapper.selectById(enId);}

    @Override
    public int updateById(EasybuyNew easybuyNew){return easybuyNewMapper.upateByPk(easybuyNew);}
    @Override
    public int outAll(){return easybuyNewMapper.outAll();}
}
